<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <ul>
        <!-- v-for遍历数组同时每遍历一次生成一个li-->
        <li v-for="name in arr">{{name}}</li>
    </ul>
    <table border="1">
        <caption>汽车列表</caption>
        <tr>
            <th>编号</th>
            <th>品牌</th>
            <th>价格</th>
            <th>类型</th>
        </tr>
        <tr v-for="(car,i) in cars">
            <th>{{i}}</th>
            <th>{{car.name}}</th>
            <th>{{car.price}}</th>
            <th>{{car.type}}</th>
        </tr>
    </table>
</div>

<!--引入vue-->
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js"></script>
<script>
    let v = new Vue({
        el: "div",
        data: {
            arr: ["悟空", "八戒", "沙僧"],
            cars: [{name: "奥迪A6", price: 400000, type: "轿车"},
                    {name: "奔驰E", price: 450000, type: "轿车"},
                      {name: "蔚来ES8", price: 500000, type: "纯电"}]
        }
    })
</script>
</body>
</html>